package com.squid.base.utils;

import com.squid.base.common.bean.LoginUserInfo;

public class LoginUserUtils {
    private static final ThreadLocal<LoginUserInfo> CONTEXT_HOLDER = new ThreadLocal<>();


    public static void setLoginUserInfo(LoginUserInfo loginUserInfo) {
        CONTEXT_HOLDER.set(loginUserInfo);
    }

    public static LoginUserInfo getContextHolder() {
        return CONTEXT_HOLDER.get();
    }

    public static void clear() {
        CONTEXT_HOLDER.remove();
    }
}
